{literal}
<script>
function checkAll()
{
	var total;
	total = document.frmAdmin.total.value;
	var i;
	for(i=1;i<total;i++) {
		id = document.getElementById("chk" + i);
		id.checked = true;
	}
}

function unCheckAll()
{
	var total;
	total = document.frmAdmin.total.value;
	var i;
	for(i=1;i<total;i++) {
		id = document.getElementById("chk" + i);
		id.checked = false;
	}
}
</script>
{/literal}
<!-- Content Area -->
<form name="frmAdmin" action="{$action}" method="post">    
<div class="dma-thumbnail">
    <div class="content">
	
        <div class="header">
            <h1 class="page-title">SELECT ITEMS</h1>
        </div>
    </div>
    <ul class="breadcrumb">
        <li><a href="#">Home</a> <span class="divider">/</span></li>
        <li class="active">Adwords</li>
    </ul>
    <div class="container-fluid">
    	{if $msg}
        <div class="alert alert-success">
        <button class="close" data-dismiss="alert" type="button">×</button>
        {$msg}
        </div>
        {/if}    
        <div class="row-fluid">
            <div class="well">
              <fieldset id="filter-bar">
                <legend class="element-invisible">Filter:</legend>
                <div><a href="#" onclick="javascript:checkAll();" >Checkall</a>&nbsp;&nbsp;&nbsp;<a href="#" onclick="javascript:unCheckAll();">Uncheckall</a></div>
                <div class="filter-search">
                    {if $categories}
                        {assign var="counter" value="1"}
                        {foreach from=$categories key=k item=v}
                            {assign var="select" value="0"}
                            {if $chk}
                                {foreach from=$chk key=k2 item=v2}
                                    {if $v == $v2}
                                        {assign var="select" value="1"}
                                    {/if}
                                {/foreach}
                            {/if}
                            {if $counter % 2 == 1}
                                <div class="clr"></div>
                            {/if}
                            <div style="float:left;width:300px"><input type="checkbox" name="chk[]" id="chk{$counter}" value="{$k}" {if $select == 1} checked="checked" {/if} /> {$v}</div>
                            {assign var="counter" value=$counter + 1}
                        {/foreach}
                    {/if}
                    <div class="clr"></div>
                    <div class="clr"></div>
                  <button type="submit">Select</button>
                </div>
              </fieldset>          
            </div>
         
        </div>
    </div>            
</div>
      <input type="hidden" value="" name="task"  />
      <input type="hidden" value="{$counter}" name="total"  />
</form>
  
  <noscript>
  Warning! JavaScript must be enabled for proper operation of the Administrator backend.
  </noscript>
  <div class="clr"></div>
</div>
<!-- end of content --> 
